﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Business;
using System.Web.Security;
public partial class admin_Create_Comment : System.Web.UI.Page {
    //Create new decryption object
    Decryption objdec = new Decryption();
    protected void Page_Load(object sender, EventArgs e) {

    }
    /// <summary>
    /// Handles the Click event of the InsertCancelButton control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    /// <action>go to View_Report.aspx with component_id and dateRecorded as query string</action>
    protected void InsertCancelButton_Click(object sender, EventArgs e) {
        string component_id = objdec.DecodeUrl(Request.QueryString["component_id"].ToString());
        string dateRecorded = objdec.DecodeUrl(Request.QueryString["dateRecorded"].ToString());
        Server.Transfer("View_Report.aspx?component_id=" + component_id + "&dateRecorded=" + dateRecorded);
    }
    /// <summary>
    /// Handles the ItemInserted event of the FormViewComment control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.Web.UI.WebControls.FormViewInsertedEventArgs"/> instance containing the event data.</param>
    /// <action>go to View_Report.aspx with component_id and dateRecorded as query string</action>
    protected void FormViewComment_ItemInserted(object sender, FormViewInsertedEventArgs e) {
        string component_id = objdec.DecodeUrl(Request.QueryString["component_id"].ToString());
        string dateRecorded = objdec.DecodeUrl(Request.QueryString["dateRecorded"].ToString());
        Server.Transfer("View_Report.aspx?component_id=" + component_id + "&dateRecorded=" + dateRecorded);
    }
    protected void LoginStatus1_LoggingOut(object sender, LoginCancelEventArgs e)
    {


        Session.Contents.Remove("UserDetails");
        Session.Abandon();
        Session.Contents.RemoveAll();
        FormsAuthentication.SignOut();
        Response.Redirect("../Default.aspx");
    }
}
